/**
 * 
 */
package edu.cmu.cs.webapp.ioms.dao;

import java.util.Date;
import java.util.List;

import edu.cmu.cs.webapp.ioms.models.Ingredient;

/**
 * @author Christian
 * 
 */
public interface IngredientDAO {
	/**
	 * 
	 * @return
	 */
	public List<Ingredient> getAllIngr() throws DataAccessException;

	/**
	 * 
	 * @return
	 */
	public boolean chargeInventory(int ing_id, double newInventory)
			throws DataAccessException;

	/**
	 * Searches for all pending order items that use the given ingredient,
	 * return the total sum of inventory quantity as the demand level
	 * 
	 * @return
	 */
	public double findDemandLevel(int ing_id) throws DataAccessException;
	
	public boolean addIng(Ingredient ing) throws DataAccessException;
	
	public boolean updateIng(Ingredient ing) throws DataAccessException;
	
	/**
	 * Fill in the ingredient info with the given ing_id
	 * 
	 * @param ing
	 *            passed in ing object with ing_id set
	 * @return <tt>Ingredient</tt> object with filled in info
	 * @throws DataAccessException
	 */
	public Ingredient getIng(Ingredient ing) throws DataAccessException;
	
	/**
	 * @param The Ingredient object that is to be deleted from the table
	 * @return whether it has been successfully deleted
	 * @throws DataAccessException
	 */
	public boolean deleteIng(Ingredient ing) throws DataAccessException;
}
